package com.xcexample.electronicclasscard.net


import okhttp3.ResponseBody
import retrofit2.Call
import retrofit2.http.*


var BaseURL = "https://kechuangapi.bigchun.com"

interface NetCall {

    /**
     * 获取用户详情
     */
    @POST("/elecard/index")
    fun getHome(): Call<ResponseBody>
    @POST("/app_version/autoConfig")
    fun autoConfig(): Call<ResponseBody>

    @GET("/v3/ip?key=d3b5b4d6e39abe62da8af86449e8be24")
    fun getLocation(): Call<ResponseBody>

    @GET("/ali/getStsToken")
    fun getTST(): Call<ResponseBody>

    @GET("/v3/weather/weatherInfo")
    fun getWind(
        @Query("city") city: String,
        @Query("key") key: String,
        @Query("extensions") extensions: String
    ): Call<ResponseBody>


    @FormUrlEncoded
    @POST("/elecard/schoolenotice")
    fun getSchoolNotice(@Field("page") page: String?): Call<ResponseBody>

    @POST("/app_version/newest")
    fun appUpdate(): Call<ResponseBody>

    @FormUrlEncoded
    @POST("/elecard/online")
    fun online(@Field("mac") mac: String?): Call<ResponseBody>

    @FormUrlEncoded
    @POST("/elecard/classlog")
    fun clock(
        @Field("stuid") stuid: String?,
        @Field("extraData") extraData: String?
    ): Call<ResponseBody>

    @FormUrlEncoded
    @POST("/elecard/getstu")
    fun stuInfo(
        @Field("stuid") stuid: String?,
        @Field("extraData") extraData: String?
    ): Call<ResponseBody>

    @FormUrlEncoded
    @POST("/elecard/classnotice")
    fun getClassNotice(@Field("page") page: String?): Call<ResponseBody>

    @FormUrlEncoded
    @POST("/elecard/kaoqinlog")
    fun getKaoqinlog(@Field("page") page: String?): Call<ResponseBody>


    /**
     * 密码登录
     */
    @FormUrlEncoded
    @POST("/login/elecard")
    fun loginByPwd(
        @Field("username") username: String?,
        @Field("password") password: String?,
        @Field("mac") mac: String?
    ): Call<ResponseBody?>?

    @FormUrlEncoded
    @POST("/login/elecardout")
    fun logoutByPwd(
        @Field("username") username: String?,
        @Field("password") password: String?
    ): Call<ResponseBody?>?

}